﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FCS.Testing.FountainConnection;
using System.Threading;

namespace FCS.Testing
{
    class Program
    {
        static void Main(string[] args)
        {
            // Let server st    art up
            Thread.Sleep(2000);


            CPQClient _connection = new CPQClient();
            
            Console.WriteLine("Use local cRIO address");
            _connection.SetDefaultCRIOAddress("test");
            
            List<string> cmd = new List<string>();
            cmd.Add("H*");
            cmd.Add("V*");
            cmd.Add("W*");
            cmd.Add("L*");

            Console.WriteLine("Sending all off");
            _connection.SendCommand("OFF", cmd, CommandPriority.kiosk, "test");
            Thread.Sleep(1000);

            cmd.Clear();
            cmd.Add("H1");

            Console.WriteLine("Sending H1 on");
            _connection.SendCommand("ON", cmd, CommandPriority.kiosk, "test");
            Thread.Sleep(1000);

            cmd.Clear();
            cmd.Add("H2");

            Console.WriteLine("Sending H2 on");
            _connection.SendCommand("ON", cmd, CommandPriority.kiosk, "test");
            Thread.Sleep(1000);

            cmd.Clear();
            cmd.Add("H3");

            Console.WriteLine("Sending H3 on");
            _connection.SendCommand("ON", cmd, CommandPriority.kiosk, "test");
            Thread.Sleep(1000);

            cmd.Clear();
            cmd.Add("*");

            Console.WriteLine("Sending all off");
            _connection.SendCommand("OFF", cmd, CommandPriority.kiosk, "test");
            Thread.Sleep(1000);

            Console.WriteLine("Sending reset");
            _connection.ResetThreshold(CommandPriority.lmoc, "test");

            _connection.Close();

            Console.Read();
        }
    }
}
